<template>
    <div class="newsinfo">
        <section v-html="content"></section>
    </div>
</template>

<script>
    import {getnewsinfoR} from '../../service/home';
    import {setDocumentTitle} from '../../uitls/common'
    import Nodata from '../../components/Nodata.vue';
    import {concat} from 'ramda';
    export default {
        components: {Nodata},
        data() {
            return {
                author: '',
                begin: '',
                bootContent: '',
                content: '',
                articles: null,
            };
        },
        created() {
            this.getinfo(this.$route.params.id);
        },
        computed: {},
        methods: {
            async getinfo(id){
                const {data}= await getnewsinfoR(id);
                if(data && data.code === 0) {
                    const {author, begin, bootContent, content, title}=data.data;
                    this.author = author;
                    this.begin = begin;
                    this.bootContent = bootContent;
                    this.content = content;
                    setDocumentTitle(title);
                }
            }
        }
    }
</script>
<style lang="less" rel="stylesheet/less">
    @import "../app";

    .newsinfo {
        display: flex;
        flex: 1;
        box-sizing: border-box;
        flex-direction: column;
        overflow: scroll;
        height: 100%;
        background: #fff;
        padding: 20px;
        p, span {
            word-wrap: break-word !important;
            word-break: break-all !important;
            white-space: inherit !important;
        }
        word-wrap: break-word;
        word-break: normal;
    }
</style>